package com.yami.shop.app.controller;

import com.yami.shop.app.utils.HttpResult;
import com.yami.shop.service.UserService;
import io.swagger.annotations.Api;
import com.yami.shop.bean.model.User;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/app/user")
@Api(tags = "用户信息接口")
@AllArgsConstructor
public class AppUserController {

    private final UserService userService;

    @PostMapping("info")
    @ResponseBody
    public HttpResult getUserInfo(String phone){
        List<User> userList = userService.getUserByPhone(phone);
        return HttpResult.success(userList);
    }


}
